package com.IO.practice;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class D05 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("untitled\\aaa.txt");
        int read = fr.read();
        fr.close();
        String i = String.valueOf((char) read);
        int num = Integer.parseInt(i);
        num++;
       
        switch (num){
            case 1:
                System.out.println("第一次");
                break;
            case 2:
                System.out.println("第二次");
                break;
            case 3:
                System.out.println("第三次");
                break;
            default:
                System.out.println("没有");
                break;
        }
        FileWriter fw = new FileWriter("untitled\\aaa.txt");
        fw.write((num + "").toCharArray());
        fw.close();
    }
}
